//收集的业务数据
var	transData ={
		transId         : "firefly",              //业务id
		promptTime		: 1500, //弹出层显示时间

		mobileNo   : "",   //手机号18100000000
		password   : "",   //会员密码
		pwd1		: "",  //第一次密码
		pwd2      : "",    
		userType   : "1",     //用户类型"0": 普通  ,"1": 律师
		mobileCheckNo       : "",       //验证码
		sessionId       : "",
		gotoUrl         : "",  //临时跳转url
		orderId			: "",  //订单号
		score			: "",   //得分
		rcDetail		: "",   //风险测评
		
		fee 			: "0",	//手续费
		bizAmt			: "",	//业务总金额
		transAmt        : "",   //金额
		payAmt          : "",    //支付
		scrollCaseList	: "", //首页滚动案件

    	storage_baseData:localStorage.getItem('storage_baseData')?JSON.parse(localStorage.getItem('storage_baseData')):{},	//基础数据
		stl_baseData:false,
		isLoadOk:false,			//判断是否加载完成是否可以跳转页面
    	caseBizModeFormStep1:''
	}
window.old_winhc_oss_url='http://winhc.oss-cn-shanghai.aliyuncs.com/';
window.winhc_oss_url='https://winhc.oss-cn-shanghai.aliyuncs.com/';
var MY_PUSH_TYPE = {
		//我的案件
		"myCase_pending": false, //申请中
		"myCase_delegate": false, //已委托
		"myCase_done": false, //已完成
		"myCase_fail": false, //未通过
		
		//我的推荐
		"myRcd_checkpending": false, //待审核
		"myRcd_repayment": false, //还款中
		"myRcd_overdue": false, //已逾期
		"myRcd_fail": false, //未通过
		
		//我的发布
		"myIssue_checkpending": false, //待审核
		"myIssue_issued": false, //已发布
		"myIssue_fail": false, //未通过
		
		//我的贷款
		"myLoan_checkpending": false, //待审核
		"myLoan_repayment": false, //还款中
		"myLoan_overdue": false, //已逾期
		"myLoan_fail": false //未通过
};

var shareFunsUrl = "http://wx.winhc.cn/page/home/shareForFrind.html?";
var avatarUrl = "http://wx.winhc.cn";

var checkLoanApplyData ={};


//function initMyPush(){
//	var initMyPushData = localStorage.getItem("MY_PUSH_TYPE");
//	if(initMyPushData != null && initMyPushData != ""){
//		MY_PUSH_TYPE = JSON.parse(initMyPushData);
//	}
//}

function receiveMessageByNative(){
//	MY_PUSH_TYPE[type] = true;
//	localStorage.setItem("MY_PUSH_TYPE",JSON.stringify(MY_PUSH_TYPE));
//	console.log("MY_PUSH_TYPE"+JSON.stringify(MY_PUSH_TYPE));
	console.log('receiveMessageByNative')
	var appElement = document.querySelector('[ng-controller=bodyCtrl]');
	//然后在获取$scope变量：
	var $scope = angular.element(appElement).scope(); 
	//向下推送我的红点
    $scope.$broadcast("mineListMessagePoint",true);
	//如果改变了其中的变量之后，需要在页面表现出来，还需要调用apply()方法：
	$scope.$apply();
}
function onNotificationOpened() {
    console.log('onNotificationOpened')
	if(transData.isLoadOk){
        var appElement = document.querySelector('[ng-controller=bodyCtrl]');
        //然后在获取$scope变量：
        var $scope = angular.element(appElement).scope();
        if(transData.sessionId != null && transData.sessionId != ""){
            $scope.$broadcast("goNext","/messageIndex");
        }else{
            $scope.$broadcast("goNext","/login");
        }
        $scope.$apply();
	}else {
		var Timer=setInterval(function () {
            if(transData.isLoadOk){
                var appElement = document.querySelector('[ng-controller=bodyCtrl]');
                //然后在获取$scope变量：
                var $scope = angular.element(appElement).scope();
                if(transData.sessionId != null && transData.sessionId != ""){
                    $scope.$broadcast("goNext","/messageIndex");
                }else{
                    $scope.$broadcast("goNext","/login");
                }
                $scope.$apply();
                clearInterval(Timer)
            }
        },100)
	}
}
//function forEachMyType(){
//	var flag = false;
//	for(var key in MY_PUSH_TYPE){
//		if(MY_PUSH_TYPE[key]){
//			flag = true;
//			break;
//		}
//	}
//	
//	return flag;
//}

var resultData = {
		caseDetailData : "",    //案源详细信息
		loginResultData: "",	//登陆后返回数据
		loginUserData : ""	//用户扩展信息
		
}

function checkLoginCacheData(data){

	
}

function assignmentData(data){
	if(data != "" && data != null){
		if(data.isSuccess == 'T'){
			var body = JSON.parse(data.body);
			transData.mobileNo = body.mobileNo;
			transData.userType = body.userType;
			resultData.loginUserData = body;
		}
	}
	
}



var bodyInfo = {
		bodyInfoPt: "",
		loanFormData : "",
		investAloneData :"",
		investNplData: "",
		bodyInfoLs: "",
    	caseId:""
}

var NPLCacheData={
		firstStepData : null,
		secondStepData : null,
		thirdStepData: null
}

//返回错误码
var ERROR_CODE = {
		noLogin : "ERROR_USER_NOT_LOGIN",
		collected: "ERROR_ALREADY_COLLECTED",
		notExist: "ERROR_USER_NOT_EXIST",
		checkNo: "ERROR_MOBILE_CHECKNO",
		pwdNotMatch: "PASSWORD_NOT_MATCH",
		errorToken: "ERROR_TOKEN",
}



//敏感词过滤
var banKeywords=['共产','产党','贱货','畜生','去你妈','你大爷','共产党','屄','二逼','傻逼','你妈','妈逼','操你','操他','操她','传销','办证','卖淫','强奸','毒品','病毒','屌','二奶','假币','枪支','贱人','杀人犯','嫖客','妓女','政治','中华人民共和国','龟孙','龟头','你奶奶','你爷爷'];
var banCode=/[\!]|[\@]|[\$]|[\%]|[\^]|[\&]|[*]|[\s]|[\~]|[\_]|[\-]|[——]|[\,]|[\.]|[\，]|[\。]|[\?]|[\？]/g;
